<!-- 申请结果页 -->
<template>
  <view v-if="shenheStatus == 0" class="result-page">
    <view class="result-section">
      <view class="pending">
        <view class="icon-box">
          <i
            class="iconfont icon-clock-fill"
            :class="[status == 1 ? 'icon-success-fill' : '']"
          ></i>
        </view>
        <template v-if="status == 1">
          <view class="status-text">已通过</view>
          <view class="status-info">恭喜你注册成功</view>
        </template>
        <!-- <template v-else-if="status == 2">
          <view class="status-text">已拒绝</view>
          <view class="status-info">{{ pass_remark }}</view>
        </template> -->
        <template v-else>
          <view class="status-text">已提交</view>
          <view class="status-info">已提交成功</view>
        </template>
      </view>
    </view>
    <view class="page-btn" @click="toBack">
      {{ $t("mdAdmin.back") + "（" + countdownText + "）" }}
    </view>
  </view>
  <Shenhe v-else-if="shenheStatus == 1"></Shenhe>
</template>

<script>
import Shenhe from "@/components/shenhe/shenhe";
export default {
  components: { Shenhe },
  data() {
    return {
      countdownText: 5,
      status: 1,
      pass_remark: ""
    };
  },
  methods: {
    toBack() {
      if (this.status == 2) {
        this.$utils.toUrl("/other/register/index", "redirectTo");
        return;
      }
      this.$utils.goBack();
    }
  },
  onLoad(t) {
    this.status = parseInt(t.status);
    this.pass_remark = t.pass_remark;

    this.timer = setInterval(() => {
      this.countdownText--;
      if (this.countdownText <= 0) {
        clearInterval(this.timer);
        // if (this.status == 2) {
        //   this.$utils.toUrl("/other/register/index", "redirectTo");
        //   return;
        // }
        this.$utils.goBack();
      }
    }, 1000);
  },
  onUnload() {
    if (this.timer) clearInterval(this.timer);
  }
};
</script>

<style lang="scss" scoped>
.result-page {
  width: 100%;
  background: #f2f2f2;
  min-height: 100vh;
  .result-section {
    background: #ffffff;
    .pending {
      padding-top: 30rpx;
      padding-bottom: 70rpx;
      display: flex;
      flex-direction: column;
      align-items: center;
      .icon-box {
        width: 130rpx;
        height: 130rpx;
        background: #ffffff;
        border-radius: 50%;
        margin: 0 auto;
        display: flex;
        justify-content: center;
        align-items: center;
        .iconfont {
          color: #f0250e;
          font-size: 190rpx;
        }
      }
      .status-text {
        font-size: 40rpx;
        font-family: PingFang SC;
        font-weight: 600;
        color: #262626;
        margin-top: 32rpx;
      }
      .status-info {
        font-size: 30rpx;
        font-family: PingFang SC;
        font-weight: 400;
        color: #8c8c8c;
        margin-top: 20rpx;
      }
    }
  }
  .page-btn {
    width: 678rpx;
    height: 88rpx;
    background: #f0250e;
    border-radius: 44rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32rpx;
    font-family: PingFang SC;
    font-weight: 500;
    color: #ffffff;
    margin: 80rpx auto 40rpx;
  }
}
</style>
